package com.woniu.model.gh.utils;

//import com.baomidou.mybatisplus.generator.FastAutoGenerator;
//import com.baomidou.mybatisplus.generator.config.OutputFile;
//import com.baomidou.mybatisplus.generator.config.rules.DateType;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CodeGenerator {

    private static final String url = "jdbc:mysql://8.134.209.206:3306/great_health";
    //private static final String url = "jdbc:mysql://192.168.137.137:3306/woniubook";

    // 设置需要生成的表名
    private static final List<String> addIncludeList = new ArrayList<>();

    //输出目录
    private static final String outputDir = "E:\\Java\\code\\stage3\\great-health\\medicalService\\src\\main\\java";

    //mapperXml生成路径
    private static final String singletonMap = "E:\\Java\\code\\stage3\\great-health\\medicalService\\src\\main\\resources\\mapper";

    static {
        // 设置需要生成的表名
        Collections.addAll(addIncludeList, "ms_hospital_reservation");
    }

    private static final String addTablePrefix = "ms_";// 设置过滤表前缀

    private static final String parent = "com.woniu.ms";// 设置父包名


/*
    public static void main(String[] args) {
        //修改url username password
        FastAutoGenerator.create(url, "root", "root")
                .globalConfig(builder -> {
                    builder.author("西瓜") // 设置作者
                            .enableSwagger() // 开启 swagger 模式
                            .fileOverride() // 覆盖已生成文件
                            .dateType(DateType.ONLY_DATE).disableOpenDir()
                            .outputDir(outputDir);// 指定输出目录
                }).packageConfig(builder -> {
                    builder.parent(parent) // 设置父包名
                            .moduleName(null) // 设置父包模块名
                            .pathInfo(Collections.singletonMap(OutputFile.xml, singletonMap));// 设置mapperXml生成路径
                }).strategyConfig(builder -> {
                    builder.entityBuilder().enableLombok();
                    builder.controllerBuilder().enableHyphenStyle().enableRestStyle();
                    builder.addInclude(addIncludeList)// 设置需要生成的表名
                            .addTablePrefix(addTablePrefix); // 设置过滤表前缀
                })
                .execute();
    }
*/

}
